package com.yuwei.order.adapter

import android.widget.ImageView
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder
import com.yuwei.database.entity.OrderEntity
import com.yuwei.image.glide.GlideImageLoader
import com.yuwei.order.R

class OrderGoodsAdapter: BaseQuickAdapter<OrderEntity, BaseViewHolder>(
    R.layout.item_order_goods
) {
    override fun convert(holder: BaseViewHolder, item: OrderEntity) {
        val icon = holder.getView<ImageView>(R.id.item_goods_image)
        GlideImageLoader.loadImage(context,icon,item.goods_default_icon)
        holder.setText(R.id.item_goods_desc,item.goods_desc)
        holder.setText(R.id.item_goods_price,"￥${item.goods_default_price}.00")
        holder.setText(R.id.item_goods_num,item.count.toString())
    }
}